home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr48 / pasclern.zip / BINOUT.PAS < prev    next >
Pascal/Delphi Source File  |  1993-04-01  |  713b  |  30 lines

  1. PROGRAM binary_output_example;
  2.  
  3. TYPE dat_rec = RECORD
  4.        count : INTEGER;
  5.        size  : REAL;
  6.        name  : STRING[30];
  7.      END;
  8.  
  9. VAR output_file : FILE of dat_rec;
  10.     dog_food    : ARRAY[1..20] OF dat_rec;
  11.     index       : BYTE;
  12.  
  13. BEGIN  (* main program *)
  14.   ASSIGN(output_file,'KIBBLES.BIT');
  15.   REWRITE(output_file);
  16.  
  17.   FOR index := 1 TO 20 DO
  18.   BEGIN
  19.     dog_food[index].count := index;
  20.     dog_food[index].size := 12345.6789;
  21.     dog_food[index].name := 'Large size Kibbles & Bits';
  22.   END;
  23.  
  24.   WRITELN('Begin outputting data');
  25.   FOR index := 1 TO 20 DO
  26.     WRITE(output_file,dog_food[index]);
  27.   CLOSE(output_file);
  28.   WRITELN('End of output');
  29. END.  (* of main program *)
  30.